package com.my.provide.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.my.dubbo.entiy.UserInfo;
import com.my.dubbo.service.UserService;
import com.my.provide.mapper.UserMapper;

public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	
	@Override
	public int add(UserInfo u) {
		return userMapper.insert(u);
	}

	@Override
	public int update(UserInfo u) {
		return userMapper.updateByPrimaryKey(u);
	}

	@Override
	public int delete(UserInfo u) {
		return userMapper.delete(u.getId());
	}

	@Override
	public UserInfo findById(Integer id) {
		return userMapper.getOne(null);
	}

	@Override
	public List<UserInfo> findAll(UserInfo u) {
		return userMapper.getAll(u);
	}

}
